var platform = null;
var userinfodata;
"undefined" != typeof wx && (platform = "wx"), "undefined" != typeof my && (platform = "my");
var copyrighttext="v1.0.0.6";
var modules = [ {
    name: "helper",
    file: "./utils/helper.js"
}, {
    name: "const",
    file: "./core/const.js"
}, {
    name: "getConfig",
    file: "./core/config.js"
}, {
    name: "page",
    file: "./core/page.js"
}, {
    name: "request",
    file: "./core/request.js"
}, {
    name: "core",
    file: "./core/core.js"
}, {
    name: "api",
    file: "./core/api.js"
}, {
    name: "getUser",
    file: "./core/getUser.js"
}, {
    name: "setUser",
    file: "./core/setUser.js"
}, {
    name: "login",
    file: "./core/login.js"
}, {
    name: "trigger",
    file: "./core/trigger.js"
}, {
    name: "uploader",
    file: "./utils/uploader.js"
}, {
    name: "orderPay",
    file: "./core/order-pay.js"
} ], args = {
    _version: "2.8.9",
    platform: platform,
    query: null,
    onLaunch: function() {
        this.getStoreData();
      // console.log(__user_info.id);
    },
    onShow: function(e) {
        e.scene && (this.onShowData = e), e && e.query && (this.query = e.query);
      // console.log(this.data.__user_info.id);
      

     
    },
    is_login: !1,
    login_complete: !1,
// 页面分享

  qcshare(){
    wx.onAppRoute(function (data) {
      // 当前页面
      let view = getCurrentPages()[getCurrentPages().length - 1];
      console.log(view);
      let _data = null;
      if (view) {
        _data = view.data;
        // 如果页面含有qcappnoshare这个变量，则不分享
        if (data.qcappnoshare) {
          return;
        } else {
          view.onShareAppMessage = function () {
            console.log(`${constant.shareinfo.path}`);
            //分享配置
            let shareinfo = {
              title: constant.shareinfo.title,
              path: _data.qcappshareinfo ? `/${view.route}?${JSON.stringify(_data.qcappshareinfo)}` : `/${view.route}`,
              imageUrl: constant.shareinfo.imageUrl ? constant.shareinfo.imageUrl : undefined
            };
            // 如果要全部到首页，则再这儿改动下
            shareinfo.path = `${constant.shareinfo.path}`
            return shareinfo;

          }
        }
      }
    })
  },


    
};


for (var i in modules) args[modules[i].name] = require("" + modules[i].file);
var _web_root = args.api.index.substr(0, args.api.index.indexOf("/index.php"));
args.webRoot = _web_root, args.getauth = function(t) {
    var o = this;
    o.core.showModal({
        title: "是否打开设置页面重新授权",
        content: t.content,
        confirmText: "去设置",
        success: function(e) {
            e.confirm ? o.hj.openSetting({
                success: function(e) {
                    t.success && t.success(e);
                },
                fail: function(e) {
                    t.fail && t.fail(e);
                },
                complete: function(e) {
                    t.complete && t.complete(e);
                }
            }) : t.cancel && o.getauth(t);
        }
    });

  // 页面分享功能
 

}, args.getStoreData = function() {
    var o = this, e = this.api, a = this.core;
    o.request({
        url: e.default.store,
        success: function(t) {
            0 == t.code && (a.setStorageSync(o.const.STORE, t.data.store), a.setStorageSync(o.const.STORE_NAME, t.data.store_name), 
            a.setStorageSync(o.const.SHOW_CUSTOMER_SERVICE, t.data.show_customer_service), a.setStorageSync(o.const.CONTACT_TEL, t.data.contact_tel), 
            a.setStorageSync(o.const.SHARE_SETTING, t.data.share_setting), o.permission_list = t.data.permission_list, 
            a.setStorageSync(o.const.WXAPP_IMG, t.data.wxapp_img), a.setStorageSync(o.const.WX_BAR_TITLE, t.data.wx_bar_title), 
            a.setStorageSync(o.const.ALIPAY_MP_CONFIG, t.data.alipay_mp_config), a.setStorageSync(o.const.STORE_CONFIG, t.data), 
            setTimeout(function(e) {
                o.config = t.data, o.configReadyCall && o.configReadyCall(t.data);
            }, 1e3));
        },
        complete: function() {}
    });
};

var app = App(args);

